var e = require("../../@babel/runtime/helpers/interopRequireDefault")(require("../../@babel/runtime/regenerator")), t = require("../../@babel/runtime/helpers/asyncToGenerator"), r = getApp(), i = (require("../../utils/api.js"), 
require("../../http/productApi.js"));

Page({
    id: -1,
    data: {
        inited: !1,
        systemInfo: r.data.systemInfo,
        imageList: null
    },
    onLoad: function(e) {
        this.id = e.id, this.reloadDetail();
    },
    reloadDetail: function() {
        var r = this;
        return t(e.default.mark(function t() {
            var a, n;
            return e.default.wrap(function(e) {
                for (;;) switch (e.prev = e.next) {
                  case 0:
                    return wx.showLoading({
                        title: "加载中…"
                    }), e.prev = 1, e.next = 4, i.boxDetail(r.id);

                  case 4:
                    a = e.sent, n = (n = (n = a.data.productDetails).replace(/\<img/gi, '<img class="block"')).replace(/\<p/gi, '<p class="break"'), 
                    r.setData({
                        inited: !0,
                        title: a.data.productTitle,
                        startTime: a.data.sellTime,
                        nodes: n
                    }), e.next = 14;
                    break;

                  case 11:
                    e.prev = 11, e.t0 = e.catch(1), console.log(e.t0);

                  case 14:
                    return e.prev = 14, wx.hideLoading(), e.finish(14);

                  case 17:
                  case "end":
                    return e.stop();
                }
            }, t, null, [ [ 1, 11, 14, 17 ] ]);
        }))();
    },
    tryOnTap: function() {
        var e = "/pages/try-series/try-series";
        r.isLogin() ? wx.navigateTo({
            url: e
        }) : r.loginThenRedirectTo(!1, e);
    }
});